#pragma once
#include <iostream>

#define Die(code)   \
    do              \
    {               \
        exit(code); \
    } while (0)

#define CONV(v) (struct sockaddr *)(v)

bool SplitString(const std::string &line, std::string *key, std::string *value, const std::string gsep)
{
    auto pos = line.find(gsep);
    if (pos == std::string::npos)
    {
        return false;
    }
    *key = line.substr(0, pos);
    *value = line.substr(pos + gsep.size());
    if (key->empty() || value->empty())
    {
        return false;
    }
    return true;
}